package com.itheima.spring.config;

import com.itheima.spring.service.MyService;
import com.itheima.spring.service.MyServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 容器配置方式
 */
@Configuration
@ComponentScan(basePackages="com.itheima.spring")
public class AppConfig {

    @Bean
    public MyService myService() {
        return new MyServiceImpl();
    }
}
